
import type { AccountRead, TransactionRead, CategoryRead } from '../types';

export const mockAccounts: AccountRead[] = [
  {
    type: 'accounts',
    id: '101',
    attributes: {
      created_at: '2023-01-01T12:00:00Z',
      updated_at: '2023-01-15T12:00:00Z',
      name: '招商银行储蓄卡',
      type: 'asset',
      currency_code: 'CNY',
      currency_symbol: '¥',
      current_balance: '18580.25',
    },
  },
  {
    type: 'accounts',
    id: '102',
    attributes: {
      created_at: '2023-01-01T12:00:00Z',
      updated_at: '2023-01-15T12:00:00Z',
      name: '支付宝',
      type: 'asset',
      currency_code: 'CNY',
      currency_symbol: '¥',
      current_balance: '5200.00',
    },
  },
  {
    type: 'accounts',
    id: '103',
    attributes: {
      created_at: '2023-01-01T12:00:00Z',
      updated_at: '2023-01-15T12:00:00Z',
      name: '招商银行信用卡',
      type: 'asset',
      currency_code: 'CNY',
      currency_symbol: '¥',
      current_balance: '-1750.50',
    },
  },
];

export const mockTransactions: TransactionRead[] = [
  {
    type: 'transactions',
    id: '206',
    attributes: {
      created_at: new Date().toISOString(),
      updated_at: new Date().toISOString(),
      group_title: '今日午餐',
      transactions: [{
        type: 'withdrawal',
        date: new Date().toISOString(), // Today's date
        amount: '35.50',
        description: '麦当劳午餐',
        source_id: '102',
        source_name: '支付宝',
        destination_id: null,
        destination_name: '餐饮',
        category_id: '304',
        category_name: '餐饮',
        tags: ['快餐'],
      }],
    },
  },
  {
    type: 'transactions',
    id: '203',
    attributes: {
      created_at: '2023-01-13T08:00:00Z',
      updated_at: '2023-01-13T08:00:00Z',
      group_title: '电费',
      transactions: [{
        type: 'withdrawal',
        date: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString(),
        amount: '185.00',
        description: '缴纳电费',
        source_id: '101',
        source_name: '招商银行储蓄卡',
        destination_id: null,
        destination_name: '生活缴费',
        category_id: '303',
        category_name: '生活缴费',
        tags: ['固定支出'],
      }],
    },
  },
  {
    type: 'transactions',
    id: '205',
    attributes: {
      created_at: '2023-01-12T20:00:00Z',
      updated_at: '2023-01-12T20:00:00Z',
      group_title: 'B站大会员',
      transactions: [{
        type: 'withdrawal',
        date: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString(),
        amount: '25.00',
        description: 'B站大会员月度续费',
        source_id: '102',
        source_name: '支付宝',
        destination_id: null,
        destination_name: '会员订阅',
        category_id: '305',
        category_name: '会员订阅',
        tags: ['娱乐', '订阅服务'],
      }],
    },
  },
  {
    type: 'transactions',
    id: '201',
    attributes: {
      created_at: '2023-01-15T10:00:00Z',
      updated_at: '2023-01-15T10:00:00Z',
      group_title: '每周采购',
      transactions: [{
        type: 'withdrawal',
        date: new Date(Date.now() - 1 * 24 * 60 * 60 * 1000).toISOString(),
        amount: '225.60',
        description: '山姆会员店购物',
        source_id: '102',
        source_name: '支付宝',
        destination_id: null,
        destination_name: '日用百货',
        category_id: '301',
        category_name: '日用百货',
        tags: ['家庭购物', '每周一次'],
      }],
    },
  },
  {
    type: 'transactions',
    id: '202',
    attributes: {
      created_at: '2023-01-14T18:30:00Z',
      updated_at: '2023-01-14T18:30:00Z',
      group_title: '工资',
      transactions: [{
        type: 'deposit',
        date: new Date(Date.now() - 2 * 24 * 60 * 60 * 1000).toISOString(),
        amount: '15000.00',
        description: '月度工资',
        source_id: null,
        source_name: '公司',
        destination_id: '101',
        destination_name: '招商银行储蓄卡',
        category_id: '302',
        category_name: '工资收入',
        tags: null,
      }],
    },
  },
  {
    type: 'transactions',
    id: '204',
    attributes: {
      created_at: '2023-01-12T20:00:00Z',
      updated_at: '2023-01-12T20:00:00Z',
      group_title: '朋友聚餐',
      transactions: [{
        type: 'withdrawal',
        date: new Date(Date.now() - 4 * 24 * 60 * 60 * 1000).toISOString(),
        amount: '364.20',
        description: '海底捞火锅',
        source_id: '103',
        source_name: '招商银行信用卡',
        destination_id: null,
        destination_name: '餐饮',
        category_id: '304',
        category_name: '餐饮',
        tags: ['社交活动', '聚餐'],
      }],
    },
  },
];

export const mockCategories: CategoryRead[] = [
  { type: 'categories', id: '301', attributes: { name: '日用百货', spent: [{ sum: '225.60' }] } },
  { type: 'categories', id: '302', attributes: { name: '工资收入', spent: [] } },
  { type: 'categories', id: '303', attributes: { name: '生活缴费', spent: [{ sum: '185.00' }] } },
  { type: 'categories', id: '304', attributes: { name: '餐饮', spent: [{ sum: '364.20' }] } },
  { type: 'categories', id: '305', attributes: { name: '会员订阅', spent: [{ sum: '25.00' }] } },
  { type: 'categories', id: '306', attributes: { name: '购物', spent: [] } },
  { type: 'categories', id: '307', attributes: { name: '交通出行', spent: [] } },
];
